<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浮动布局练习2</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        li {
            list-style: none;
            /* 清除小圆点 */
        }

        .box {
            width: 1226px;
            height: 285px;
            background-color: aqua;
            margin: 0 auto;
        }
        .box li {
            width: 296px;
            height: 285px;
            background-color: bisque;
            float: left;
            margin-right: 14px;
        }
        /* .last {
            margin-right: 0;
            手动将最后一个盒子外边距改成0 
        } 
        因为权重比.box li小，所以不能清除外边距
        */
        .box .last {
            margin-right: 0;
        }
    </style>

</head>
<body>
    <ul class="box">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li class="last">4</li>
    </ul>
    <img src="img/浮动练习2.1.png" alt=""><br>
    <img src="img/浮动练习2.2.png" alt="">

</body>
</html>